import { useState } from "react";
import { ConfigProvider, theme, App as AntdApp } from "antd";
import HomePage from "./pages/HomePage";
import "./App.css";

function App() {
  const [isDarkMode, setIsDarkMode] = useState(false);

  return (
    <ConfigProvider
      theme={{
        algorithm: isDarkMode ? theme.darkAlgorithm : theme.defaultAlgorithm,
      }}
    >
      <AntdApp>
        <HomePage
          darkMode={isDarkMode}
          onToggleDarkMode={() => setIsDarkMode(!isDarkMode)}
        />
      </AntdApp>
    </ConfigProvider>
  );
}

export default App;
